<?php

/**
 * OntoWiki skosrelations module template
 */

?>

<?php if ( !empty($this->relations) ): ?>
	<div about="<?php echo $this->resourceUri; ?>">
	<ul class="bullets-none separated">
		<?php foreach ( $this->relations as $relationUri => $relation ): ?>
	        <li><?php echo $relation['title']; ?>:
	            <ul class="inline separated">
	                <?php $i = 0; ?>
	                <?php foreach ( $relation['instances'] as $instanceUri => $instance ): ?>
	                    <?php if ( ++$i == count($relation['instances']) ): ?>
	                        <li rel="<?php echo $relationUri; ?>"  class="last-child"><a class="hasMenu" resource="<?php echo $instanceUri; ?>" href="<?php echo $instance['url']; ?>"><?php echo $instance['title']; ?></a></li>
	                    <?php else: ?>
	                        <li rel="<?php echo $relationUri; ?>"><a class="hasMenu" resource="<?php echo $instanceUri; ?>" href="<?php echo $instance['url']; ?>"><?php echo $instance['title']; ?></a></li>
	                    <?php endif; ?>
                    <?php endforeach; ?>
	            </ul>
	        </li>
	    <?php endforeach; ?>
	</ul>
	</div>
<?php else: ?>
	<p class="messagebox info"><?php echo $this->_($this->message); ?></p>
<?php endif; ?>
